import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        /*pingpangSporter pps = new pingpangSporter("刘",23);
        System.out.println(pps.getName()+","+pps.getAge());

        pps.speakEnglish();
        pps.study();*/

        //创建乒乓球俱乐部
        PingpangClub club = new PingpangClub();
        BasketballClub Club = new BasketballClub();

        // 创建更多乒乓球运动员
        PingpangSporter sporter1 = new PingpangSporter("张", 20);
        PingpangSporter sporter2 = new PingpangSporter("李", 22);
        PingpangSporter sporter3 = new PingpangSporter("王", 21);

        // 创建乒乓球教练
        PingpangCoach coach1 = new PingpangCoach("赵教练", 35);
        PingpangCoach coach2 = new PingpangCoach("孙教练", 38);

        //创建更多的篮球运动员
        BasketballSporter Sporter1 = new BasketballSporter("赵", 20);
        BasketballSporter Sporter2 = new BasketballSporter("朱", 22);
        BasketballSporter Sporter3 = new BasketballSporter("凉", 21);

        //创建更多的篮球教练
        BasketballCoach Coach1 = new BasketballCoach("杨教练", 35);
        BasketballCoach Coach2 = new BasketballCoach("麦教练", 38);

        // 运动员和教练加入俱乐部
       // club.addSporter(pps);
        club.addSporter(sporter1);
        club.addSporter(sporter2);
        club.addSporter(sporter3);
        club.addCoach(coach1);
        club.addCoach(coach2);
        Club.addSporter(Sporter1);
        Club.addSporter(Sporter2);
        Club.addSporter(Sporter3);
        Club.addCoach(Coach1);
        Club.addCoach(Coach2);

        // 俱乐部组织训练
        club.organizeTraining();
        Club.organizeTraining();

        // 俱乐部组织比赛
        club.organizeMatch();
        Club.organizeMatch();

        // 显示俱乐部统计信息
        club.showClubStats();
        Club.showClubStats();

        // 与用户交互
        Scanner scanner = new Scanner(System.in);
        System.out.println("是否继续组织比赛？(y/n)");
        String choice = scanner.nextLine();
        // 循环询问用户是否继续组织比赛
        while ("y".equalsIgnoreCase(choice)) {
            club.organizeMatch();
            club.showClubStats();
            System.out.println("是否继续组织比赛？(y/n)");
            choice = scanner.nextLine();
        }
        System.out.println("感谢使用乒乓球俱乐部管理系统！");
        scanner.close();
    }
}

